home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 2
/
Atari Mega Archive CD - Volume 2.iso
/
minix
/
up1510b.tgz
/
up1510b
/
src
/
commands
/
pwd.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-07-23
|
341b
|
24 lines
/*
* Print Working Directory (pwd)
*/
#include <sys/types.h>
#include <limits.h>
#include <unistd.h>
char dir[PATH_MAX+1];
main()
{
char *p;
p = getcwd(dir, PATH_MAX);
if (p == (char *) NULL) {
std_err("pwd: cannot search some directory on the path\n");
exit(1);
}
write(1, p, strlen(p));
write(1, "\n", 1);
exit(0);
}